close all;
clear all;
clc;

recordName = 'SmartingEEGRecord [14-06-10-15-29-18].bin';

androidSdkPath = 'c:\dev\android\sdk\';
numOfChannels = 29;

commandStr = [androidSdkPath 'platform-tools\adb pull /sdcard/' '"' recordName '"'];
system(commandStr);

recordID = fopen(recordName, 'r');
data = uint8(fread(recordID, 'uint8'));

descEnd = find(data == 0, 1);
desc = char(data(1:descEnd)');

data(1:descEnd) = [];
data = typecast(data, 'double');

numOfSamples = floor(length(data) / numOfChannels);
data = data(1:numOfChannels * numOfSamples);
data = reshape(data, numOfChannels, numOfSamples);

fclose(recordID);
clear androidSdkPath;
clear ans;
clear appPackageName;
clear commandStr;
clear recordID;
clear recordName;